import React from 'react'
import Luo from 'iscroll-luo';
import { useState,useEffect } from "react"
import {useDispatch,useSelector} from "react-redux"
import * as action from "../action"
import { Empty } from 'react-vant';
function Pull() {
    let [data, setData] = useState([1, 2, 3])
    let dispatch = useDispatch()
    let store = useSelector((state)=>{
        return {
            ...state.shopreducer
        }
    })
   const onDown =()=>{
      dispatch(action.getpulllist())
    
    }
  useEffect(()=>{
       dispatch(action.getpulllist())
  },[])
    /** 上拉加载更多 **/
   const onUp=()=> {
    dispatch(action.getpulllist("shangla"))
   
    }
    return (
        <div style={{ position: 'relative', height: '100vh' }}>
            <Luo
                id='id'
                onDown={() => onDown()}
                onUp={() => onUp()}
            >
                {
                    store.pullarr && store.pullarr.length?   store.pullarr.map((v, i) =>
                        <div key={i}>
                            <span>{v.title}</span>
                            {/* <img src={v.img} alt="" /> */}
                        </div>
                    ):<Empty description="暂无数据" />
                }
            </Luo>
        </div>
    )
}

export default Pull